var Router = Backbone.Router.extend({
    routes : {
        "" : "home",
        "all" : "all",
        "ing" : "ing",
        "finish" : "finish",
        "unfinish" : "unfinish",
        "pub_task" : "pub_task",
        "personal" : "personal",
        "personal/:department" : "personal",
        "publish" : "publish",
        "personalEdit" : "personalEdit",
        "boardcast" : "boardcast",
        "broadcastEdit/:id" : "broadcastEdit",
        "broadcastEdit" : "broadcastEdit"
    }
});

var route = new Router();

route.on('route:broadcastEdit', function(id){
    v_task.render();
    v_right.render();
    v_boardCast.render({ model : m_broadcast, id : id });
    $(".list_kind_ul").html("<li class='list target' id='list_kind'>修改公告</li>");
});

route.on('route:boardcast', function(){
    v_task.render();
    v_right.render();
    v_boardCastPub.render({});
    $(".list_kind_ul").html("<li class='list target' id='list_kind'>发布公告</li>");
});

route.on('route:personalEdit', function(id){
    v_task.render();
    v_right.render();
    v_personal.render();
    $(".list_kind_ul").html("<li class='list target' id='list_kind'>个人信息</li>");
});

route.on('route:publish', function(){
    v_right.render();
    v_task.render();
    v_ul.render();
    $(".list_kind_ul").html("<li class='list target' id='list_kind'>发布任务</li>");
});

route.on('route:home',function(){
    v_right.render();
    v_boardCast.render({});
    v_task.render();
});

route.on('route:personal', function(department){
    v_right.render();
    v_boardCast.render({ department : department });
    v_task.render();
});

route.on('route:all',function(){
    v_all.render();
    v_right.render();
    v_task.render();
});

route.on('route:ing', function(){
    v_ing.render();
    v_right.render();
    v_task.render();
});

route.on('route:finish', function(){
   v_fin.render();
   v_right.render();
    v_task.render();
});

route.on('route:unfinish', function(){
   v_unfin.render();
   v_right.render();
    v_task.render();
});

route.on('route:pub_task', function(){
//    alert(1);
    v_put.render();
    v_right.render();
    v_task.render();
    $(".list_kind_ul").html("<li class='list target' id='list_kind'>发布任务</li>");
});
